﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="XuatHang.aspx.cs" Inherits="XuatHang" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script language="javascript" type="text/javascript">
    function calculate() {
        var tong = document.getElementById("<%=txtKLTong.ClientID %>").value;
        var bi = document.getElementById("<%=txtKLBi.ClientID %>").value;

        if (tong == '') tong = "0";
        if (bi == '') bi = "0";
        document.getElementById("<%=txtKLHang.ClientID %>").value = parseFloat(tong) - parseFloat(bi)
        bi.focus();
    }
    function tongkltram() {
        var da12 = document.getElementById("<%=txtDa12.ClientID %>").value;
        var da24 = document.getElementById("<%=txtDa24.ClientID %>").value;
        var cat = document.getElementById("<%=txtCatVang.ClientID %>").value;
        var ximang = document.getElementById("<%=txtXiMang.ClientID %>").value;
        var nuoc = document.getElementById("<%=txtNuoc.ClientID %>").value;
        var phugia = document.getElementById("<%=txtPhuGia.ClientID %>").value;

        if (da12 == '') da12 = "0";
        if (da24 == '') da24 = "0";
        if (cat == '') cat = "0";
        if (ximang == '') ximang = "0";
        if (nuoc == '') nuoc = "0";
        if (phugia == '') phugia = "0";
        document.getElementById("<%=txtTongKLTram.ClientID %>").value = parseFloat(da12) + parseFloat(da24) + parseFloat(cat) + parseFloat(ximang) + parseFloat(nuoc) + parseFloat(phugia);
        
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Quản lý xuất hàng</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            <td width="16%">
                                <span style="margin-left: 5px;">Số phiếu</span><br />
                                <asp:TextBox ID="txtSoPhieu" ReadOnly="true" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Ca làm việc</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" ID="dlCaLamViec"
                                    DataValueField="IDs" DataTextField="TenCa">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                                    ControlToValidate="dlCaLamViec" ErrorMessage="Chọn ca làm việc" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Ngày bán</span><br />
                                <asp:TextBox ID="txtNgayBan" AutoPostBack="true" runat="server" 
                                    CssClass="form-control with98" ontextchanged="txtNgayBan_TextChanged"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="txtNgayBan" ErrorMessage="Nhập ngày bán" Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtNgayBan"
                                    Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender12" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtNgayBan" ValidChars="/-" />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Giờ bán</span><br />
                                <asp:TextBox ID="txtGioBan" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Trạm xuất</span><br />
                                <asp:DropDownList runat="server" 
                                    CssClass="form-control width98" ID="dlTramTron" DataValueField="IDs" DataTextField="TenTramTron" >
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator18" runat="server"
                                    ControlToValidate="dlTramTron" ErrorMessage="Chọn trạm xuất" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Loại ca bơm</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlLoaiCaBom">
                                    <asp:ListItem Text="--Không dùng bơm--" Value="0"></asp:ListItem>
                                    <asp:ListItem Text="Theo ca 1" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Theo ca 2" Value="9"></asp:ListItem>
                                    <asp:ListItem Text="Theo khối" Value="2"></asp:ListItem>
                                    <%--<asp:ListItem Text="Bơm thuê theo ca 1" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Bơm thuê theo ca 2" Value="7"></asp:ListItem>
                                    <asp:ListItem Text="Bơm thuê theo khối" Value="4"></asp:ListItem>--%>
                                    <asp:ListItem Text="Thuê bơm theo ca 1" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="Thuê bơm theo ca 2" Value="8"></asp:ListItem>
                                    <asp:ListItem Text="Thuê bơm theo khối" Value="6"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td width="16%">
                                <span style="margin-left: 5px;">Biển số</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" ID="dlBienSo"
                                    DataValueField="IDs" DataTextField="DoiTuongChi" AutoPostBack="True" 
                                    onselectedindexchanged="dlBienSo_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator3" runat="server"
                                    ControlToValidate="dlBienSo" ErrorMessage="Chọn biển số xe" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Lái xe</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" ID="dlLaiXe"
                                    DataValueField="IDs" DataTextField="HoTen" Enabled="true">
                                </asp:DropDownList>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Loại sản phẩm</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" ID="dlLoaiSanPham"
                                    DataValueField="IDs" DataTextField="TenLoaiSP">
                                </asp:DropDownList>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Loại phụ gia</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" ID="dlLoaiPhuGia"
                                    DataValueField="IDs" DataTextField="TenLoaiVL" AutoPostBack="true" 
                                    onselectedindexchanged="dlLoaiPhuGia_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Loại cấp phối</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" ID="dlLoaiCapPhoi"
                                    DataValueField="IDs" DataTextField="TenLoaiCP">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator5" runat="server"
                                    ControlToValidate="dlLoaiCapPhoi" ErrorMessage="Chọn loại cấp phối" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Tiền hỗ trợ cước</span><br />
                                <asp:TextBox ID="txtHoTroCuoc" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtHoTroCuoc" ValidChars=",." />
                            </td>
                        </tr>
                        <tr>
                            <td width="16%">
                                <span style="margin-left: 5px;">Bên mua</span><br />
                                <asp:DropDownList runat="server" Visible="true" CssClass="form-control width98" 
                                    ID="dlBenMua" AutoPostBack="true"
                                    DataValueField="IDs" DataTextField="TenKhachHang" 
                                    onselectedindexchanged="dlBenMua_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator6" runat="server"
                                    ControlToValidate="dlBenMua" ErrorMessage="Chọn bên mua" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Công trình</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" 
                                    ID="dlCongTrinh" DataValueField="IDs" AutoPostBack="true"
                                    DataTextField="TenCongTrinh" 
                                    onselectedindexchanged="dlCongTrinh_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator19" runat="server"
                                    ControlToValidate="dlCongTrinh" ErrorMessage="Chọn công trình" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Hạng mục</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlHangMuc" DataValueField="IDs"
                                    DataTextField="TenHangMuc">
                                </asp:DropDownList>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">KL tổng</span><br />
                                <asp:TextBox ID="txtKLTong" runat="server" CssClass="form-control with98" 
                                    AutoPostBack="false" onchange="calculate()" ></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator7" runat="server"
                                    ControlToValidate="txtKLTong" ErrorMessage="Nhập khối lượng tổng" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtKLTong" ValidChars=",." />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">KL bì</span><br />
                                <asp:TextBox ID="txtKLBi" runat="server" CssClass="form-control with98" 
                                    AutoPostBack="false" onchange="calculate()"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator8" runat="server"
                                    ControlToValidate="txtKLBi" ErrorMessage="Nhập khối lượng bì" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtKLBi" ValidChars=",." />
                            </td>
                            <td>
                                <span style="margin-left: 5px;">KL hàng</span><br />
                                <asp:TextBox ID="txtKLHang" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="16%">
                                <span style="margin-left: 5px;">Mác thực xuất</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlMacTX" DataValueField="IDs"
                                    DataTextField="TenMacBeTong">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator10"
                                    runat="server" ControlToValidate="dlMacTX" ErrorMessage="Chọn mác thực xuất"
                                    Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Mác khách hàng</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlMacKH" DataValueField="IDs"
                                    DataTextField="TenMacBeTong">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator9" runat="server"
                                    ControlToValidate="dlMacKH" ErrorMessage="Chọn mác khách hàng" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Độ sụt</span><br />
                                <asp:TextBox ID="txtDoSut" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">KL thực xuất</span>
                                <asp:CheckBox ID="ckMuaBeTong" runat="server" AutoPostBack="true" 
                                    Checked="false" Text="Mua bê tông" 
                                    oncheckedchanged="ckMuaBeTong_CheckedChanged" />
                                <br />
                                <asp:TextBox ID="txtKLTX" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator11"
                                    runat="server" ControlToValidate="txtKLTX" ErrorMessage="Nhập khối lượng thực xuất"
                                    Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtKLTX" ValidChars=",." />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">KL khách hàng</span><br />
                                <asp:TextBox ID="txtKLKhachHang" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator12"
                                    runat="server" ControlToValidate="txtKLKhachHang" ErrorMessage="Nhập khối lượng khách hàng"
                                    Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtKLKhachHang" ValidChars=",." />
                            </td>
                            <td>
                                <span style="margin-left: 5px;">KL NVKD</span><br />
                                <asp:TextBox ID="txtKLNVKD" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender6" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtKLNVKD" ValidChars=",." />
                            </td>
                        </tr>
                        <tr>
                            <td width="16%">
                                <span style="margin-left: 5px;">Đá 1*2</span><br />
                                <asp:TextBox ID="txtDa12" runat="server" CssClass="form-control with98" 
                                   onchange="tongkltram()" ></asp:TextBox>
                                
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender7" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtDa12" ValidChars=",." />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Đá 2*4</span><br />
                                <asp:TextBox ID="txtDa24" runat="server" CssClass="form-control with98" 
                                    onchange="tongkltram()" AutoPostBack="false"></asp:TextBox>
                                
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender8" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtDa24" ValidChars=",." />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Cát vàng</span><br />
                                <asp:TextBox ID="txtCatVang" runat="server" CssClass="form-control with98" 
                                    onchange="tongkltram()" AutoPostBack="false"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator15"
                                    runat="server" ControlToValidate="txtCatVang" ErrorMessage="Nhập khối lượng cát"
                                    Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtCatVang" ValidChars=",." />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Xi măng</span><br />
                                <asp:TextBox ID="txtXiMang" runat="server" CssClass="form-control with98" 
                                    onchange="tongkltram()" ></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator16"
                                    runat="server" ControlToValidate="txtXiMang" ErrorMessage="Nhập khối lượng xi măng"
                                    Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender10" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtXiMang" ValidChars=",." />
                            </td>
                            <td width="16%">
                                <span style="margin-left: 5px;">Nước</span><br />
                                <asp:TextBox ID="txtNuoc" runat="server" CssClass="form-control with98" 
                                   onchange="tongkltram()"  ></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator17"
                                    runat="server" ControlToValidate="txtNuoc" ErrorMessage="Nhập khối lượng nước"
                                    Display="None" Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender11" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtNuoc" ValidChars=",." />
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Phụ gia</span><br />
                                <asp:TextBox ID="txtPhuGia" ReadOnly="true" runat="server" CssClass="form-control with98" 
                                   onchange="tongkltram()"  ></asp:TextBox>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender13" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtPhuGia" ValidChars=",." />
                            </td>
                        </tr>
                        <tr>
                            <td width="16%">
                                <span style="margin-left: 5px;">Tổng KL trạm trộn</span><br />
                                <asp:TextBox ID="txtTongKLTram" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Nhân viên KD</span><br />
                                <asp:TextBox ID="txtNVKD" ReadOnly="true" runat="server" CssClass="form-control with98"></asp:TextBox>
                            </td>
                            <td colspan="2">
                                <span style="margin-left: 5px;">NCC bê tông</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" Enabled="false" ID="dlNhaCungCap" DataValueField="IDs"
                                    DataTextField="TenNCC">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Giá mua bê tông</span><br />
                                <asp:TextBox ID="txtGiaMuaBeTong" Enabled="false" runat="server" CssClass="form-control with98"></asp:TextBox>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender16" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtGiaMuaBeTong" ValidChars=",." />
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Ghi chú</span><br />
                                <asp:TextBox ID="txtGhiChu" runat="server" CssClass="form-control withall"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6">
                                <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                                    Text="Lưu lại" CssClass="btn btn-primary" onclick="btnSave_Click" />
                                <asp:Button ID="btncapnhat" ValidationGroup="Them" runat="server" Text="Cập nhật" CssClass="btn btn-info"
                                     Visible="false" onclick="btncapnhat_Click" />
                                <asp:Button ID="btnCancel" runat="server" Text="Nhập mới" 
                                    CssClass="btn btn-warning" onclick="btnCancel_Click"/>
                                    &nbsp;&nbsp;<asp:Label ID="lbTrangThai" runat="server" Text="Dữ liệu thời điểm này đang bị tạm khóa"></asp:Label>
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải xuất các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                </div>
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <b>Danh sách xuất hàng</b>
                        <asp:TextBox ID="txtKey" runat="server" Width="400px" placeholder="Chọn thời gian và nhập họ tên khách hàng để tìm nhanh" CssClass="form-control with98" ></asp:TextBox>
                        <asp:Button ID="btnTimKiem2" runat="server" Text="Tìm kiếm" 
                                    CssClass="btn btn-warning" onclick="btnTimKiem2_Click"/>
                    </div>
                    <div>
                    <asp:DropDownList ID="dlThang" AutoPostBack="true" runat="server" Width="150px" 
                            CssClass="form-control" onselectedindexchanged="dlThang_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlNam" runat="server" Width="140px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:TextBox ID="txtTuNgay" runat="server" AutoPostBack="true" OnTextChanged="dlThang_SelectedIndexChanged" placeholder="Từ ngày" Visible="true"  Width="100px" CssClass="form-control"></asp:TextBox>&nbsp;
                        <asp:TextBox ID="txtDenNgay" runat="server" placeholder="Đến ngày" OnTextChanged="dlThang_SelectedIndexChanged" AutoPostBack="true" Visible="true"
                             Width="100px" CssClass="form-control"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtTuNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDenNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender14" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtTuNgay" ValidChars="/-" />
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender15" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtDenNgay" ValidChars="/-" />
                        <asp:DropDownList ID="dlLoaiKH" ToolTip="Chọn loại khách hàng" runat="server"  AutoPostBack="true"
                            DataValueField="IDs" Width="200px" CssClass="form-control"
                            DataTextField="TenLoaiKH" 
                            onselectedindexchanged="dlLoaiKH_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlCongTrinhLoc" ToolTip="Chọn công trình" runat="server" 
                            DataValueField="IDs" Width="250px" CssClass="form-control"
                            DataTextField="TenCongTrinh" AutoPostBack="true" 
                            onselectedindexchanged="dlCongTrinhLoc_SelectedIndexChanged" >
                        </asp:DropDownList>

                        <asp:DropDownList ID="dlMacHD" ToolTip="Chọn mác hợp đồng" runat="server" 
                            DataValueField="IDs" Width="150px" CssClass="form-control" 
                            DataTextField="TenMacBeTong" AutoPostBack="true" 
                            onselectedindexchanged="dlMacHD_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlLoaiDa" ToolTip="Chọn loại đá" runat="server" Width="140px" CssClass="form-control" DataTextField="LoaiDa" DataValueField="IDs">
                        </asp:DropDownList>

                        <asp:Button ID="btnXem" CssClass="btn btn-warning" runat="server" Text="Tìm kiếm"
                            OnClick="btnXem_Click" />
                            <asp:HiddenField ID="hdTuNgay" runat="server" />
                            <asp:HiddenField ID="hdDenNgay" runat="server" />
                    </div>
                    <div style="width: 100%; margin-top: 0px;overflow-x: auto;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="true" CssClass="form-control withall"
                            Width="3000px" OnRowCommand="GV_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Xóa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/img/delete-24.png"
                                            OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("IDs")%>'
                                            Text="Xóa" CommandName="Del" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbSua" runat="server" Width="15px" Height="15px" ImageUrl="~/img/edit.ico"
                                            CommandArgument='<%#Eval("IDs")%>' Text="Sửa" CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="NgayBan" ItemStyle-CssClass="padding" HeaderText="Ngày bán"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="SoPhieu" ItemStyle-CssClass="padding" HeaderText="Số phiếu"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    
                                    <asp:BoundField DataField="BienSo" ItemStyle-CssClass="padding" HeaderText="Biển số"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="LaiXe" ItemStyle-CssClass="padding" HeaderText="Lái xe"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                    <asp:BoundField DataField="GioXuat" ItemStyle-CssClass="padding" HeaderText="Giờ xuất"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="CongTrinh" ItemStyle-CssClass="padding" HeaderText="Công trình"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                    <asp:BoundField DataField="DoSut" ItemStyle-CssClass="padding" HeaderText="Độ sụt"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="MacTX" ItemStyle-CssClass="padding" HeaderText="Mác thực xuất"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="MacKH" ItemStyle-CssClass="padding" HeaderText="Mác hợp đồng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="KLThucXuat" ItemStyle-CssClass="padding" HeaderText="KL thực xuất"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="KLKhachHang" ItemStyle-CssClass="padding" HeaderText="KL bán"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="KLTong" ItemStyle-CssClass="padding" HeaderText="KL tổng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="KLBi" ItemStyle-CssClass="padding" HeaderText="KL bì"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="KLHang" ItemStyle-CssClass="padding" HeaderText="KL hàng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />

                                    <asp:BoundField DataField="LoaiDa" ItemStyle-CssClass="padding" HeaderText="Loại đá"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="LoaiPhuGia" ItemStyle-CssClass="padding" HeaderText="Phụ gia"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="LoaiCapPhoi" ItemStyle-CssClass="padding" HeaderText="Cấp phối"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="Da12" ItemStyle-CssClass="padding" HeaderText="Đá 1*2"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="Da24" ItemStyle-CssClass="padding" HeaderText="Đá 2*4"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="CatVang" ItemStyle-CssClass="padding" HeaderText="Cát vàng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    
                                    <asp:BoundField DataField="Nuoc" ItemStyle-CssClass="padding" HeaderText="Nước"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="XiMang" ItemStyle-CssClass="padding" HeaderText="Xi măng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="PhuGia" ItemStyle-CssClass="padding" HeaderText="Phụ gia"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="KLTramTron" ItemStyle-CssClass="padding" HeaderText="Tổng phiếu trộn"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="LoaiCaBom" ItemStyle-CssClass="padding" HeaderText="Loại ca bơm"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                    
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Right" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                    </div>
                    <div style="margin: 5px;">
                            <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                            <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                                OnClick="btnPre_Click" />
                            <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                                OnClick="btnNext_Click" />
                        </div>
                </div>
                <asp:HiddenField ID="hdID" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
